<?php
App::uses('AppModel', 'Model');
/**
 * CIDADE Model
 *
 * @property UF $UF
 * @property Pais $PAIS
 * @property Endereco $TBENDERECO
 */
class Cidade extends AppModel {

     public $displayField =  array('Código', 'Nome', 'DDD', 'UF', 'Pais', 'Valor Diária', 'Código');
/**
 * Use table
 *
 * @var mixed False or table name
 */
	public $useTable = 'CIDADE';

/**
 * Primary key field
 *
 * @var string
 */
	public $primaryKey = 'CD_CID';

/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'CD_CID' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'NM_CID' => array(
			'alphanumeric' => array(
				'rule' => array('alphanumeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'DDD_CID' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'CD_PAIS' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'UF' => array(
			'className' => 'UF',
			'foreignKey' => 'CD_UF'
		),
		'PAIS' => array(
			'className' => 'Pais',
			'foreignKey' => 'CD_PAIS'
		)
	);

/**
 * hasMany associations
 *
 * @var array
 */
        /*
	public $hasMany = array(
		'TBENDERECO' => array(
			'className' => 'Endereco',
			'foreignKey' => 'CD_CID',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);
*/
}
